<template>
	<view class="boxContainer">
		<view class="boxHeader" v-show="true">
			<view class="hdLeft">
				<view class="avatar">
					<image :src="userAvatar" mode=""></image>
				</view>
				<view class="name">
					<text>{{userName}}</text>
				</view>
			</view>
			<view class="hdRight">
				<view class="more">
					<image src="../static/jzqIcon/more.png" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 标签区域开始 -->
		<view class="tags">
			<view class="tagItem">
				<text class="tagStyle">#</text>
				<text class="tagTitle">{{tagName}}</text>
			</view>
		</view>
		<!-- 标签区域结束 -->
		<!-- 日志文本内容开始 -->
		<view class="logContent">
			<text @click="toLogDetail">{{content}}</text>
			<view class="contentImgs">
				<image :src="imgUrl" mode="widthFix"></image>
			</view>

		</view>
		<!-- 日志文本内容结束 -->
		<!-- 底部分享内容开始 -->
		<view class="footer">
			<view class="ftLeft">
				<view class="share">
					<view class="shareImg">
						<image src="../static/jzqIcon/share.png" mode=""></image>
					</view>
					<text>分享</text>
				</view>
			</view>
			<view class="ftRight">
				<view class="rightContent">
					<view class="message" @click="toReply">
						<view class="messageImg">
							<image src="../static/jzqIcon/message.png" mode=""></image>
						</view>
						<text>{{messageName}}</text>
					</view>
					<view class="dianzan">
						<view class="dianzanImg">
							<image src="../static/jzqIcon/dianzan.png" mode=""></image>
						</view>
						<text>{{dianzanName}}</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 底部分享内容结束 -->
	</view>

</template>

<script>
	export default {
		props: {
			// 点赞名称
			dianzanName: {
				type: String,
				default: "点赞"
			},
			// 信息图标名称
			messageName: {
				type: String,
				default: "回复"
			},
			// 标签名称
			tagName: {
				type: String,
				default: "学习心得"
			},
			// 用户头像
			userAvatar: {
				type: String,
				default: ""
			},
			// 控制头部显示与隐藏
			headerShow: {
				type: Boolean,
				default: false,
			},
			// 内容
			content: {
				type: String,
				default: "123213"
			},
			// 图片路径
			imgUrl: {
				type: String,
				default: ""
			},
			// 数据组件ID
			id: {
				type: String,
				default: ""
			},
			// 用户名
			userName: {
				type: String,
				default: "小北爱测评"
			}


		},
		name: "commonLogBox",
		data() {
			return {

			};
		},
		methods: {
			toLogDetail() {
				uni.navigateTo({
					url: "/pages/ischoolQZ/logDetail/logDetail"
				})
				this.$emit("openDetail", this.id)
			},
			toReply() {
				uni.navigateTo({
					url: "/pages/ischoolQZ/reply/reply"
				})
				this.$emit("openReply", this.id)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.boxContainer {
		.boxHeader {
			display: flex;
			color: #939393;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;

			.hdLeft {
				display: flex;

				.avatar {
					margin-right: 10rpx;

					image {
						width: 40rpx;
						height: 40rpx;
						border-radius: 50%;
					}
				}
			}

			.hdRight {
				.more {
					image {
						width: 64rpx;
						height: 34rpx;
					}
				}
			}
		}

		.tags {
			margin: 20rpx 0;

			.tagItem {
				width: 196rpx;
				height: 52rpx;
				background-color: #CCCCCC;
				line-height: 56rpx;
				text-align: center;
				color: #FFFFFF;
				border-radius: 30rpx;

				.tagTitle {
					color: #2A6CAC;
				}

				.tagStyle {
					width: 32rpx;
					height: 32rpx;
					background-color: #255584;
					padding: 0 8rpx;
					border-radius: 50%;
					margin-right: 8rpx;
				}
			}
		}

		.logContent {
			.contentImgs {
				display: flex;
				justify-content: space-evenly;
				margin: 20rpx 0;

				image {
					height: 180rpx;
				}
			}
		}

		.footer {
			overflow: hidden;
			margin-bottom: 20rpx;

			image {
				width: 40rpx;
				height: 40rpx;
			}

			.ftLeft {
				float: left;

				.share {
					display: flex;
					align-items: center;
				}

			}

			.ftRight {
				float: right;

				.rightContent {
					display: flex;
					align-items: center;
				}

				.message {
					display: flex;
					margin-right: 15rpx;

					.messageImg {
						margin-right: 8rpx;
					}

				}

				.dianzan {
					display: flex;

					.dianzanImg {
						margin-right: 8rpx;
					}
				}
			}
		}
	}
</style>
